import type { Order } from '@/types/api'

interface FetchOrdersAPIResData {
  code: number
  msg: string
  time: string
  data: Order[]
}

interface FetchOrdersAPIParams {
  lat: string
  lng: string
}

export function fetchOrdersAPI(params: FetchOrdersAPIParams, token: string) {
  return httpInstance.get<FetchOrdersAPIResData, FetchOrdersAPIParams>(
    '/api/driver/orderList',
    { params, headers: { token } },
  )
}
